home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / awksrc.zip / MAKEFILE.IN < prev    next >
Text File  |  1992-11-04  |  8KB  |  253 lines

  1. # Makefile for GNU Awk.
  2. #
  3. # Copyright (C) 1986, 1988-1992 the Free Software Foundation, Inc.
  4. # This file is part of GAWK, the GNU implementation of the
  5. # AWK Progamming Language.
  6. # GAWK is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. # GAWK is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with GAWK; see the file COPYING.  If not, write to
  16. # the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. # User tunable macros -- CHANGE THESE IN Makefile.in RATHER THAN IN 
  19. # Makefile, OR configure WILL OVERWRITE YOUR CHANGES
  20.  
  21. DESTDIR=
  22. BINDIR=    /usr/local/bin
  23. MANDIR=    /usr/local/man/man1
  24. MANEXT=    1
  25.  
  26. # CFLAGS: options to the C compiler
  27. #
  28. #    -O    optimize
  29. #    -g    include dbx/sdb info
  30. #    -pg    include new (gmon) profiling info
  31. #
  32. #    The provided "configure" is used to turn a config file (samples in
  33. #    the "config" directory into commands to edit config.in into
  34. #    a suitable config.h and to edit Makefile.in into Makefile.
  35. #    To port GAWK, create an appropriate config file using the ones in
  36. #    the config directory as examples and using the comments in config.in
  37. #    as a guide.
  38. #
  39.  
  40. CC=         gcc
  41. ##MAKE_CC## CC = cc
  42.  
  43. OPTIMIZE=    -g -O
  44. PROFILE=    #-pg
  45. DEBUG=        #-DMALLOCDEBUG #-DDEBUG #-DFUNC_TRACE #-DMPROF
  46. LINKSTATIC=    #-Bstatic
  47. WARN=        #-W -Wunused -Wimplicit -Wreturn-type -Wcomment    # for gcc only
  48.  
  49. # Parser to use on grammar - any one of the following will work
  50. PARSER = yacc
  51. #PARSER = byacc
  52. #PARSER = bison -y
  53.  
  54. # Set LIBS to any libraries that are machine specific
  55. LIBS =
  56.  
  57. # Cray 2 running Unicos 5.0.7
  58. ##MAKE_LIBNET## LIBS = -lnet
  59.  
  60.  
  61. # Systems with alloca in /lib/libPW.a
  62. ##MAKE_ALLOCA_PW## LIBS = -lPW
  63.  
  64. # ALLOCA - only needed if you use bison
  65. #    Set equal to alloca.o if your system is S5 and you don't have
  66. #    alloca. Uncomment one of the rules below to make alloca.o from
  67. #    either alloca.s or alloca.c.
  68. #    This should have already been done automatically by configure.
  69. #
  70. #    Some systems have alloca in libPW.a, so LIBS=-lPW may work, too.
  71. ##MAKE_ALLOCA_C## ALLOCA= alloca.o
  72. ##MAKE_ALLOCA_S## ALLOCA= alloca.o
  73.  
  74. FLAGS=
  75. ##MAKE_RS6000## FLAGS = -qchars=signed
  76.  
  77. # VMS POSIX, VAXC V3.2
  78. ##MAKE_VMS-Posix## FLAGS = -UVMS -D__STDC__=0
  79.  
  80. # HP/Apollo running cc version 6.7 or earlier
  81. ##MAKE_Apollo## FLAGS = -U__STDC__ -A run,sys5.3
  82. ##MAKE_Apollo## LIBS = -A sys,any
  83.  
  84. # Use -s -Xlinker -object flags when you are satisfied that
  85. # that the program compiles correctly
  86. ##MAKE_NeXT## FLAGS = -DGFMT_WORKAROUND #-s -Xlinker -object
  87.  
  88. CFLAGS= -DGAWK $(FLAGS) $(DEBUG) $(LINKSTATIC) $(PROFILE) $(OPTIMIZE) $(WARN)
  89.  
  90. # object files
  91. AWKOBJS = main.o eval.o builtin.o msg.o iop.o io.o field.o array.o \
  92.     node.o version.o missing.o re.o getopt.o
  93.  
  94. ALLOBJS = $(AWKOBJS) awktab.o
  95.  
  96. # GNUOBJS
  97. #    GNU stuff that gawk uses as library routines.
  98. GNUOBJS= regex.o dfa.o $(ALLOCA)
  99.  
  100. # source and documentation files
  101. SRC =    main.c eval.c builtin.c msg.c version.c \
  102.     iop.c io.c field.c array.c node.c missing.c re.c getopt.c
  103.  
  104. ALLSRC= $(SRC) awktab.c
  105.  
  106. AWKSRC= awk.h awk.y $(ALLSRC) patchlevel.h protos.h config.in getopt.h
  107.  
  108. GNUSRC = alloca.c alloca.s dfa.c dfa.h regex.c regex.h
  109.  
  110. COPIES = missing/system.c missing/tzset.c \
  111.     missing/memcmp.c missing/memcpy.c missing/memset.c \
  112.     missing/random.c missing/strcase.c missing/strchr.c \
  113.     missing/strerror.c missing/strtod.c \
  114.     missing/strftime.c missing/strftime.3 
  115.  
  116. SUPPORT = support/texindex.c support/texinfo.tex
  117.  
  118. DOCS= gawk.1 gawk.texi
  119.  
  120. INFOFILES= gawk.info gawk.info-* \
  121.        gawk.aux gawk.cp gawk.cps gawk.fn gawk.fns gawk.ky gawk.kys \
  122.        gawk.pg gawk.pgs gawk.toc gawk.tp gawk.tps gawk.vr gawk.vrs
  123.  
  124. MISC =    NEWS COPYING FUTURES Makefile.* PROBLEMS README* PORTS POSIX \
  125.     mungeconf configure ACKNOWLEDGMENT LIMITATIONS
  126.  
  127. OTHERS= pc/* atari/* vms/*
  128.  
  129. ALLDOC= gawk.dvi $(INFOFILES)
  130.  
  131. ALLFILES= $(AWKSRC) $(GNUSRC) $(COPIES) $(MISC) $(DOCS) $(ALLDOC) $(OTHERS) \
  132.       $(SUPPORT)
  133.  
  134. # Release of gawk.  There can be no leading or trailing white space here!
  135. REL=2.14
  136.  
  137. # rules to build gawk
  138. gawk: $(ALLOBJS) $(GNUOBJS) $(REOBJS)
  139.     $(CC) -o gawk $(CFLAGS) $(ALLOBJS) $(GNUOBJS) $(REOBJS) -lm $(LIBS)
  140.  
  141. $(AWKOBJS) regex.o dfa.o:    awk.h dfa.h regex.h
  142.  
  143. getopt.o:    getopt.h
  144.  
  145. main.o: patchlevel.h
  146.  
  147. awktab.c: awk.y
  148.     $(PARSER) -v awk.y
  149. ##MAKE_VMS-Posix##     mv ytab.c awktab.c
  150. ##MAKE_VMS-Posix## dummy.awk_tab.target:
  151.     sed '/^extern char .malloc(), .realloc();$$/d' y.tab.c >awktab.c
  152.     rm y.tab.c
  153.  
  154. config.h: config.in
  155.     @echo You must provide a config.h!
  156.     @echo Run \"./configure\" to build it for known systems
  157.     @echo or copy config.in to config.h and edit it.; exit 1
  158.  
  159. install: gawk
  160.     install -s gawk $(DESTDIR)$(BINDIR)
  161.     install -c gawk.1 $(DESTDIR)$(MANDIR)/gawk.$(MANEXT)
  162.  
  163. # ALLOCA: uncomment this if your system (notably System V boxen)
  164. # does not have alloca in /lib/libc.a or /lib/libPW.a
  165. #
  166. # If your machine is not supported by the assembly version of alloca.s,
  167. # use the C version which follows instead.  It uses the default rules to
  168. # make alloca.o.
  169. #
  170. # One of these rules should have already been selected by running configure.
  171.  
  172.  
  173. ##MAKE_ALLOCA_S## alloca.o: alloca.s
  174. ##MAKE_ALLOCA_S##     /lib/cpp < alloca.s | sed '/^#/d' > t.s
  175. ##MAKE_ALLOCA_S##     as t.s -o alloca.o
  176. ##MAKE_ALLOCA_S##     rm t.s
  177.  
  178. ##MAKE_ALLOCA_C## alloca.o: alloca.c
  179.  
  180. # auxiliary rules for release maintenance
  181. lint: $(ALLSRC)
  182.     lint -hcbax $(FLAGS) $(ALLSRC)
  183.  
  184. xref:
  185.     cxref -c $(FLAGS) $(ALLSRC) | grep -v '    /' >xref
  186.  
  187. clean:
  188.     rm -rf *.o core awk.output gmon.out make.out y.output \
  189.            *.orig *.rej */*.orig */*.rej
  190.  
  191. cleaner:    clean
  192.     rm -f gawk awktab.c
  193.  
  194. clobber: clean
  195.     rm -f $(ALLDOC) gawk.log
  196.  
  197. gawk.dvi: gawk.texi
  198.     tex gawk.texi; texindex gawk.??
  199.     tex gawk.texi; texindex gawk.??
  200.     tex gawk.texi
  201.  
  202. gawk.info:    gawk.texi
  203.     makeinfo gawk.texi
  204.  
  205. gawk-test-$(REL).tar.Z::
  206.     -rm -f gawk-test-$(REL).tar.Z
  207.     tar -cf - test | compress >gawk-test-$(REL).tar.Z
  208.  
  209. dist:    $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) $(COPIES) $(SUPPORT) clean
  210.     ./configure msdos
  211.     mv config.h pc
  212.     -rm -rf gawk-$(REL) gawk-$(REL).*.tar.Z
  213.     -mkdir gawk-$(REL)
  214.     cp -p $(AWKSRC) $(GNUSRC) $(DOCS) $(MISC) gawk-$(REL)
  215.     -mkdir gawk-$(REL)/missing
  216.     cp -p $(COPIES) gawk-$(REL)/missing
  217.     -mkdir gawk-$(REL)/atari
  218.     cp -p  atari/* gawk-$(REL)/atari
  219.     -mkdir gawk-$(REL)/pc
  220.     cp -p pc/* gawk-$(REL)/pc
  221.     -mkdir gawk-$(REL)/vms
  222.     cp -p vms/* gawk-$(REL)/vms
  223.     -mkdir gawk-$(REL)/config
  224.     cp -p config/* gawk-$(REL)/config
  225.     -mkdir gawk-$(REL)/support
  226.     cp -p support/* gawk-$(REL)/support
  227.     tar -cf - test | (cd gawk-$(REL); tar xpf - )
  228.     tar -cf - gawk-$(REL) | compress > gawk-$(REL).`gawk '{print $$3}' patchlevel.h`.tar.Z
  229.  
  230. gawk-doc-$(REL).tar.Z:    gawk.info gawk.dvi gawk.1
  231.     -rm -rf gawk-doc-$(REL) gawk-doc-$(REL).tar.Z
  232.     -mkdir gawk-doc-$(REL)
  233.     cp -p $(INFOFILES) gawk.dvi gawk-doc-$(REL)
  234.     nroff -man gawk.1 > gawk-doc-$(REL)/gawk.1.pr
  235.     tar -cf - gawk-doc-$(REL) | compress > gawk-doc-$(REL).tar.Z
  236.  
  237. gawk-ps-$(REL).tar.Z:    gawk.dvi gawk.1
  238.     -rm -rf gawk-ps-$(REL) gawk-ps-$(REL).tar.Z
  239.     -mkdir gawk-ps-$(REL)
  240.     dvips -o !cat gawk.dvi > gawk-ps-$(REL)/gawk.postscript
  241.     pstroff -man gawk.1 > gawk-ps-$(REL)/gawk.1.ps
  242.     tar -cf - gawk-ps-$(REL) | compress > gawk-ps-$(REL).tar.Z
  243.  
  244. release: gawk-src-$(REL).tar.Z gawk-doc-$(REL).tar.Z gawk-ps-$(REL).tar.Z \
  245.      gawk-test-$(REL).tar.Z
  246.  
  247. test:    gawk
  248.     cd test; make -k
  249.